<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>管理员编辑</title>
	<meta name="keywords" content="" />
    <meta name="description" content="LarryCMS Version:1.09" />
	<meta name="Author" content="larry" />
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="/static/common/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="/static/common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="/static/css/common.css" media="all">
</head>
<body>
<div class="fadeInUp animated addata_box">
	<form class="layui-form layui-form-pane">
		<input type="hidden" name="id" value="{$info.id}">
		<div class="layui-form-item">
			<label class="layui-form-label"><em>*</em>姓名</label>
			<div class="layui-input-block">
				<input type="text" name="name" value="{$info.name}" lay-verify="required" placeholder="请输入管理员姓名" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><em>*</em>手机号</label>
			<div class="layui-input-block">
				<input type="text" name="mobile" value="{$info.mobile}" lay-verify="required|phone" placeholder="请输入管理员手机号" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><em>*</em>密码</label>
			<div class="layui-input-block">
				<input type="password" name="password" value="123456" lay-verify="required|password" placeholder="请输入密码" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label"><em>*</em>角色</label>
			<div class="layui-input-block">
				<select name="role_id" lay-verify="required">
					<option value="">请选择角色</option>
					{volist name="list" id="vo" key="k" }
					  	<option value="{$k}" {if condition="$info['role_id'] eq $k"}selected{/if}>{$vo}</option>
					{/volist}
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-block layui-input-7">
				<input type="radio" name="status" lay-filter="status" checked value="1" title="启用">
				<input type="radio" name="status" lay-filter="status" value="0" title="禁用">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="button" class="layui-btn" lay-submit="" lay-filter="auth">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
<!-- 加载js文件 -->
<script type="text/javascript" src="/static/common/frame/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript">
layui.use(['form','layer','jquery'],function(){
	var $ = layui.$,
		form = layui.form,
		layer = layui.layer;
    form.on('submit(auth)', function (data) {
        // 提交到方法 默认为本身
        $.post("{:url('editData')}",data.field,function(res){
            if(res.code > 0){
                layer.msg(res.msg,{time:1000,icon:1},function(){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.tableIns.reload();
                    parent.layer.close(index);
                });
            }else{
                layer.msg(res.msg,{time:1000,icon:2});
            }
        });
    });
});
</script>
</body>
</html>